<template>
  <div class="enterprise-Vehicle-wrap">
    <div class="title">
      企业名下车辆排行
    </div>
    <div class="vehicle-list">
      <el-scrollbar style="height: 100%;width: 100%;">
        <div class="vehicle-item"
             v-for="(item, index) in enterpriseList"
             :key="item.company"
        >
          <div class="index">{{index+1}}</div>
          <div class="name">{{item.company}}</div>
          <div class="num">{{item.carNum}}辆</div>
        </div>

      </el-scrollbar>
    </div>
  </div>
</template>

<script>
// @ is an alias to /src
// import commonDialog from '@/components/commonDialog/common.dialog'
// import commonForm from '@/components/commonForm/commonForm.component'
import api from '@/api/common.api'

export default {
  name: 'enterpriseVehicle',
  components: {
    // commonDialog,
    // commonForm
  },
  data () {
    return {
      enterpriseList: [
      ]
    }
  },
  methods: {
    getIndexCompanyRatio (Eparams) {
      let params = Eparams
      if(!params){
        params = {
          type: 2   //2汽油 1柴油
        }
      }
      api.getIndexCompanyRatio(params).then(res=>{
        this.enterpriseList = res.content.companyCarNum
      })
    },
  },
  created () {
    this.getIndexCompanyRatio()
  },
  mounted () {

  }
}
</script>
<style lang="stylus">
  .enterprise-Vehicle-wrap{
    height: calc(100% - 30px);
    padding-top: 30px;
    .title{
      padding-left: 30px;
      font-size: 22px;
      line-height: 80px;
      text-shadow: 0 0 10px #17788e;
    }
    .vehicle-list{
      height: calc(100% - 110px);
      .el-scrollbar__wrap{
        overflow-x: hidden;
        margin-right: -20px;
      }

      .vehicle-item{
        background: #193156d6;
        padding: 30px 50px;
        display: flex;
        font-size: 18px;
        justify-content: space-between;
        //box-shadow: 0 0 10px red;
        &+.vehicle-item{
          margin-top: 20px;
        }
        .num{
          font-family: 'YouSheBiaoTiHei';
          color: #4FB3FF;
        }
      }
    }
  }
</style>
